package com.lekang.service.impl;

import java.util.List;
import com.lekang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lekang.mapper.PrepaymentRechargeMapper;
import com.lekang.domain.PrepaymentRecharge;
import com.lekang.service.IPrepaymentRechargeService;

/**
 * 预存款充值Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-15
 */
@Service
public class PrepaymentRechargeServiceImpl implements IPrepaymentRechargeService 
{
    @Autowired
    private PrepaymentRechargeMapper prepaymentRechargeMapper;

    /**
     * 查询预存款充值
     * 
     * @param id 预存款充值主键
     * @return 预存款充值
     */
    @Override
    public PrepaymentRecharge selectPrepaymentRechargeById(Long id)
    {
        return prepaymentRechargeMapper.selectPrepaymentRechargeById(id);
    }

    /**
     * 查询预存款充值列表
     * 
     * @param prepaymentRecharge 预存款充值
     * @return 预存款充值
     */
    @Override
    public List<PrepaymentRecharge> selectPrepaymentRechargeList(PrepaymentRecharge prepaymentRecharge)
    {
        return prepaymentRechargeMapper.selectPrepaymentRechargeList(prepaymentRecharge);
    }

    /**
     * 新增预存款充值
     * 
     * @param prepaymentRecharge 预存款充值
     * @return 结果
     */
    @Override
    public int insertPrepaymentRecharge(PrepaymentRecharge prepaymentRecharge)
    {
        prepaymentRecharge.setCreateTime(DateUtils.getNowDate());
        return prepaymentRechargeMapper.insertPrepaymentRecharge(prepaymentRecharge);
    }

    /**
     * 修改预存款充值
     * 
     * @param prepaymentRecharge 预存款充值
     * @return 结果
     */
    @Override
    public int updatePrepaymentRecharge(PrepaymentRecharge prepaymentRecharge)
    {
        prepaymentRecharge.setUpdateTime(DateUtils.getNowDate());
        return prepaymentRechargeMapper.updatePrepaymentRecharge(prepaymentRecharge);
    }

    /**
     * 批量删除预存款充值
     * 
     * @param ids 需要删除的预存款充值主键
     * @return 结果
     */
    @Override
    public int deletePrepaymentRechargeByIds(Long[] ids)
    {
        return prepaymentRechargeMapper.deletePrepaymentRechargeByIds(ids);
    }

    /**
     * 删除预存款充值信息
     * 
     * @param id 预存款充值主键
     * @return 结果
     */
    @Override
    public int deletePrepaymentRechargeById(Long id)
    {
        return prepaymentRechargeMapper.deletePrepaymentRechargeById(id);
    }
}
